package jwebtester.dal.entities;

// Generated Oct 31, 2012 3:54:40 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * CompetencyModelEntity generated by hbm2java
 */
@Entity
@Table(name = "COMPETENCY_MODEL", schema = "PUBLIC", catalog = "PUBLIC")
public class CompetencyModelEntity implements java.io.Serializable {

	private Integer id;
	private OrganizationEntity organizationEntity;
	private String name;
	private String description;
	private boolean isDeleted;
	private Set<CompetencyModelHistoryEntity> competencyModelHistoryEntities = new HashSet<CompetencyModelHistoryEntity>(
			0);
	private Set<ModelsCompetenciesEntity> modelsCompetenciesEntities = new HashSet<ModelsCompetenciesEntity>(
			0);

	public CompetencyModelEntity() {
	}

	public CompetencyModelEntity(OrganizationEntity organizationEntity, String name,
			boolean isDeleted) {
		this.organizationEntity = organizationEntity;
		this.name = name;
		this.isDeleted = isDeleted;
	}

	public CompetencyModelEntity(OrganizationEntity organizationEntity, String name,
			String description, boolean isDeleted,
			Set<CompetencyModelHistoryEntity> competencyModelHistoryEntities,
			Set<ModelsCompetenciesEntity> modelsCompetenciesEntities) {
		this.organizationEntity = organizationEntity;
		this.name = name;
		this.description = description;
		this.isDeleted = isDeleted;
		this.competencyModelHistoryEntities = competencyModelHistoryEntities;
		this.modelsCompetenciesEntities = modelsCompetenciesEntities;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ORGANIZATION_ID", nullable = false)
	public OrganizationEntity getOrganizationEntity() {
		return this.organizationEntity;
	}

	public void setOrganizationEntity(OrganizationEntity organizationEntity) {
		this.organizationEntity = organizationEntity;
	}

	@Column(name = "NAME", nullable = false, length = 128)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "DESCRIPTION", length = 512)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "IS_DELETED", nullable = false)
	public boolean isIsDeleted() {
		return this.isDeleted;
	}

	public void setIsDeleted(boolean isDeleted) {
		this.isDeleted = isDeleted;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "competencyModelEntity")
	public Set<CompetencyModelHistoryEntity> getCompetencyModelHistoryEntities() {
		return this.competencyModelHistoryEntities;
	}

	public void setCompetencyModelHistoryEntities(
			Set<CompetencyModelHistoryEntity> competencyModelHistoryEntities) {
		this.competencyModelHistoryEntities = competencyModelHistoryEntities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "competencyModelEntity")
	public Set<ModelsCompetenciesEntity> getModelsCompetenciesEntities() {
		return this.modelsCompetenciesEntities;
	}

	public void setModelsCompetenciesEntities(
			Set<ModelsCompetenciesEntity> modelsCompetenciesEntities) {
		this.modelsCompetenciesEntities = modelsCompetenciesEntities;
	}

}
